-
Notifications
You must be signed in to change notification settings - Fork 694
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Translate _ as __ #1008
Translate _ as __ #1008
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 thanks @AndrewGaspar !
We attempt to handle this sort of thing during the codegen phase, and have a map of method names and field names where we count how many times a name has been seen, and append that number to the name for disambiguation. So you get It isn't perfect, but... shrug |
@bors-servo r+ |
📌 Commit aa11524 has been approved by |
Translate _ as __ This change treats _ as a reserved identifier to resolve the bug reported in #631. I have one concern - if the header has both an `_` and `__` identifier in the global namespace, this will cause a conflict. However, it seems like we already don't handle that case for `keyword_` (e.g. `abstract_`, `alignof_`, etc.) so it doesn't seem like we need a solution specifically for `__` in this change. Fixes #631.
☀️ Test successful - status-travis |
This change treats _ as a reserved identifier to resolve the bug reported in #631.
I have one concern - if the header has both an
_
and__
identifier in the global namespace, this will cause a conflict. However, it seems like we already don't handle that case forkeyword_
(e.g.abstract_
,alignof_
, etc.) so it doesn't seem like we need a solution specifically for__
in this change.Fixes #631.